
<script setup lang="ts">
import Nav from "./Nav.vue";
import Sidebar from "./Sidebar.vue";
import Title from "./Title.vue";
import Logo from "./Logo.vue";
import { useStore } from "vuex";
const store = useStore();
</script>
<template>
  <div
    class="homeBox"
    :style="{
      'grid-template-columns': store.state.sidebarCollapse
        ? '64px 1fr'
        : '200px 1fr',
    }"
  >
    <div class="logo">
      <Logo :sidebarCollapse="store.state.sidebarCollapse" />
    </div>
    <div class="header" style="background: rgb(84, 92, 100)">
      <Nav />
    </div>
    <div class="sidebar" style="background: rgb(84, 92, 100)">
      <Sidebar style="height: 100%" />
    </div>
    <div class="title">
      <GTitle />
    </div>
    <div class="content">
      <el-main
        style="
          max-height: calc(100vh - 120px);
          overflow: auto;
          position: relative;
        "
      >
        <el-scrollbar>
          <router-view></router-view>
        </el-scrollbar>
      </el-main>
    </div>
  </div>
</template>
<style lang="scss" scoped>
.homeBox {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: 60px 60px 1fr;
  // grid-template-columns: 200px 1fr;
  grid-template-areas:
    "logo header"
    "sidebar title"
    "sidebar content";
}
.logo {
  grid-area: logo;
}
.header {
  grid-area: header;
}
.sidebar {
  grid-area: sidebar;
}
.title {
  grid-area: title;
}
.content {
  grid-area: content;
}
</style>